/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin		 	*/
/*	Project:	GlbRtbEng-1.0.0			*/
/*	Author:		gong_libin			*/
/*	Date:		2016_06_26			*/
/*	File:		GlbRtbBase.h			*/
/********************************************************/

#ifndef	_GLBRTBBASE_H
#define	_GLBRTBBASE_H

#include "GlbShm.h"
#include "GlbSet.h"

class CGlbRtbBase
{
public:
	CGlbRtbBase() {}
	virtual ~CGlbRtbBase() {}

	void GlbRtbBaseZero();
	void GlbRtbBaseDelete();
	void GlbRtbBaseReset(UINT uiSum);
	GlbCls::CGlbSet& GlbRtbBaseGetRef() {return m_CSet;}
	GlbCls::CGlbSet* GlbRtbBaseGetPtr() {return &m_CSet;}
	int GlbRtbBaseCreate(key_t iKey, UINT uiSum, UINT uiSize, GlbCls::GlbSetCompPtr pComp);

	virtual void GlbRtbBaseCount() {return;}
	virtual int GlbRtbBaseInput(void* pPara) {return GLB_SUCCESS;}

	template<typename K, typename V>
	inline int GlbRtbBaseSearch(K k, V v) {return m_CSet.GlbSetSearch(k, v);}

protected:
	GlbCls::CGlbSet m_CSet;

private:
	GlbIpc::CGlbShm m_CShm;

};

#endif /* _GLBRTBBASE_H */
